package cn.yunbamboos.media.zlm.client.param;

public class AddFFmpegSourceApiParams extends GenericParams {

    private String srcUrl; //	Y	FFmpeg拉流地址,支持任意协议或格式(只要FFmpeg支持即可)
    private String dstUrl; //	Y	FFmpeg rtmp推流地址，一般都是推给自己，例如rtmp://127.0.0.1/live/stream_form_ffmpeg
    private Integer timeoutMs = 10000; //	Y	FFmpeg推流成功超时时间
    private Boolean enableHls = false; //	Y	是否开启hls录制
    private Boolean enableMp4 = false; //	Y	是否开启mp4录制
    private String ffmpegCmdKey; //	N	配置文件中FFmpeg命令参数模板key(非内容)，置空则采用默认模板:ffmpeg.cmd

    @Override
    public void setParams() {
        super.setParams();
        this.set("src_url", srcUrl, true)
                .set("dst_url", dstUrl, true)
                .set("timeout_ms", timeoutMs, true)
                .set("enable_hls", enableHls, true)
                .set("enable_mp4", enableMp4, true)
                .set("ffmpeg_cmd_key", ffmpegCmdKey, false)
        ;
    }

    public AddFFmpegSourceApiParams setSrcUrl(String srcUrl) {
        this.srcUrl = srcUrl;
        return this;
    }

    public AddFFmpegSourceApiParams setDstUrl(String dstUrl) {
        this.dstUrl = dstUrl;
        return this;
    }

    public AddFFmpegSourceApiParams setFfmpegCmdKey(String ffmpegCmdKey){
        this.ffmpegCmdKey = ffmpegCmdKey;
        return this;
    }
}
